Skip to content

feat(id-caps): host-side policy point for the MCP bridge (spike #6300 step 4, #7916) - #13192

Merged
dezren39 merged 1 commit into
mainfrom
lane-qe-7916
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-qe-7916

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Refs #7916 — spike step 4/5 for #6300 (policy point), after step 2's bridge (PR #13161).

What lands

New id_caps::mcp_policy module: the host-side policy point the bridge's module docs defer to. A PolicySession wraps a BridgeSession and runs every agent tool call through the design's order (#6300 §§6–7):

  1. Capability ceiling set at role grant — tools, worlds, object classes, program-invoke allowlist. Anything outside is refused, audited, and never reaches the bridge.
  2. Per-session quota (local budget per §9.3, not waiting on F12.10) over frames / tool calls / program invocations, charged before execution. A charge that would exceed the budget refuses the action and parks the agent; parking surfaces to the driver as the first-class world event agent parked, quota exhausted. world.leave is never refused — the exit is charged nothing and still audited.
  3. Audit: exactly one event per action, refusals and stale-input rejections included, hash-chained and signed with the host's journal key (ed25519, house style). verify_audit_chain checks sequence, links, hashes, and signatures end-to-end. The stale-decision rule is enforced here: a screen_revision token naming anything but the latest observed revision is refused as stale input. The agent is the subject, never the editor — log and spend are read-only from the session API. Owner summary renders actions / spend / refusals in the §7 shape.

program.invoke arrives with step 5; the policy point already enforces its allowlist and charges its quota axis (an admitted invoke currently ends as an audited bridge refusal, charge standing).

Verification

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-23T10:32:13Z",
    "session_id": null,
    "lane": null,
    "host": "amd",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "oc-code-08",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…step 4, #7916)

New mcp_policy module wrapping BridgeSession: capability-ceiling
check set at role grant (tools, worlds, object classes, program
allowlist), per-session quota charged before execution with visible
parking on exhaustion ("agent parked, quota exhausted"), and one
signed, hash-chained audit event per action including refusals and
stale-input rejections, with an owner-readable summary. The agent
is the audit subject, never its editor: log and spend are read-only
from the session API.
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b6eb81ce-0f4b-41db-ba57-52fbdbed49ba
Commits

Reviewing files that changed from the base of the PR and between 01861f1 and fc82f4e.

Files selected for processing: 2

  • pkgs/id/crates/id-caps/src/lib.rs
  • pkgs/id/crates/id-caps/src/mcp_policy.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T10:33:44.219324Z fc82f4e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant